global $wgValidSkinNames;
return $wgValidSkinNames;
}
-
+
/**
* Normalize a skin preference value to a form that can be loaded.
* If a skin can't be found, it will fall back to the configured
function normalizeKey( $key ) {
global $wgDefaultSkin;
$skinNames = Skin::getSkinNames();
-
+
if( $key == '' ) {
// Don't return the default immediately;
// in a misconfiguration we need to fall back.
if( isset( $skinNames[$key] ) ) {
return $key;
}
-
+
// Older versions of the software used a numeric setting
// in the user preferences.
$fallback = array(
if( isset( $fallback[$key] ) ){
$key = $fallback[$key];
}
-
+
if( isset( $skinNames[$key] ) ) {
return $key;
} else {
return 'standard';
}
}
-
+
/**
* Factory method for loading a skin of a given type
* @param string $key 'monobook', 'standard', etc
*/
function &newFromKey( $key ) {
$key = Skin::normalizeKey( $key );
-
+
$skinNames = Skin::getSkinNames();
$skinName = $skinNames[$key];
-
+
global $IP;
# Grab the skin class and initialise it. Each skin checks for PHPTal
$out->addLink( array( 'rel' => 'shortcut icon', 'href' => '/favicon.ico' ) );
$this->addMetadataLinks($out);
-
+
$this->mRevisionId = $out->mRevisionId;
wfProfileOut( $fname );
global $wgUser, $wgContLang, $wgUser, $wgRequest, $wgTitle, $wgAllowUserCss;
$s = '';
-
+
if( $wgAllowUserCss && $wgUser->isLoggedIn() ) { # logged in
if($wgTitle->isCssSubpage() && $this->userCanPreview( $action ) ) {
$s .= $wgRequest->getText('wpTextbox1');
$embed = "<span dir='$dir'>";
$pop = '</span>';
$t = $embed . implode ( "$pop | $embed" , $wgOut->mCategoryLinks ) . $pop;
-
+
$msg = count( $wgOut->mCategoryLinks ) === 1 ? 'categories1' : 'categories';
$s = $this->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, 'Categories' ),
wfMsg( $msg ), 'article=' . urlencode( $wgTitle->getPrefixedDBkey() ) )
}
return $s;
}
-
+
/**
* Return URL options for the 'edit page' link.
* This may include an 'oldid' specifier, if the current page view is such.
*/
function editUrlOptions() {
global $wgArticle;
-
+
if( $this->mRevisionId && ! $wgArticle->isCurrent() ) {
return "action=edit&oldid=" . intval( $this->mRevisionId );
} else {